<!Doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>大旺福--{$title}</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="/assets/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/assets/layui/css/global.css" media="all">
</head>
<body>
    <div class="layui-layout layui-layout-admin">

        <!-- header start -->
        {include file="layout/header.html"}
        <!-- header end -->

        <!-- nav start-->
        {include file="layout/nav.html"}
        <!-- nav end-->

        <!-- main start -->
        <div class="layui-body site-demo">
            <div class="layui-main">
                <fieldset class="layui-elem-field layui-field-title">
                    <legend>{$title}</legend>
                </fieldset>
                <div class="site-block">
                    <form action="" class="layui-form">
                        <div class="layui-form-item">
                            <label class="layui-form-label">分类名称</label>
                            <div class="layui-input-block">
                                <input type="text" name="category_name" placeholder="请输入分类名称" value="{$category_info['category_name']}" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">分类类型</label>
                            <div class="layui-input-inline">
                                <input type="hidden" name="category_type" value="{$category_info['category_type']}">
                                <select lay-filter="category_type">
                                    <option value="1" {if $category_info['category_type'] eq '1' }selected{/if}>普通分类</option>
                                    <option value="2" {if $category_info['category_type'] eq '2' }selected{/if}>自定义分类</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">所属分类</label>
                            <div class="layui-input-block">
                                <input type="hidden" name="categroy_id" value="{$category_info['parent_id']}">
                                <button type="button" class="layui-btn layui-btn-warm layui-btn-small add-category" style="margin-top:5px;">
                                    <i class="layui-icon">&#xe608;</i>
                                    <span>{if $category_info['parent_category_name'] neq ''}{$category_info['parent_category_name']} -> {/if}{$category_info['category_name']}</span>
                                </button>
                                <div class="category-list layui-clear site-block layui-hide" style="padding:10px;">
                                    <ul id="category-tree" class="layui-box layui-tree" style="margin-bottom:10px;"></ul>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item category-product-block {if $category_info['category_type'] eq '1' }layui-hide{/if}">
                            <label class="layui-form-label">产品关联</label>
                            <div class="layui-input-block">
                                {if $category_info['category_type'] eq '1' }
                                <input type="hidden" name="product_ids" value="" data-value="{$pids}">
                                {else}
                                <input type="hidden" name="product_ids" value="{$pids}" data-value="{$pids}">
                                {/if}
                                <button type="button" class="layui-btn layui-btn-small add-product" style="margin-top:5px;">
                                    <i class="layui-icon">&#xe608;</i> <span>产品选择</span>
                                </button>
                                <button type="button" class="layui-btn layui-btn-small layui-btn-danger selected-product" style="margin-top:5px;">
                                    <i class="layui-icon">&#xe63c;</i> <span>已选产品</span>
                                </button>
                                <div class="category-list-2 layui-clear site-block layui-hide" style="padding:10px;">
                                    <ul id="category-tree2" class="layui-box layui-tree" style="margin-bottom:10px;"></ul>
                                </div>
                                <div class="product-list layui-clear site-block layui-hide" style="padding:10px;">
                                    <ul class="category-product-list">
                                    </ul>
                                    <button type="button" class="layui-btn layui-btn-warm confirm-select-product" style="margin-top:10px;">确认</button>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">分类图标</label>
                            <div class="layui-input-block">
                                <img src="{if $category_info['category_icon'] != ''}http://img.dawangfu.com{$category_info['category_icon']}{/if}"
                                 id="category_icon" alt="无" width="30" height="30" style="border:1px solid #e6e6e6;">
                                <input type="file" name="file" lay-type="images" class="layui-upload-file">
                            </div>
                            <input type="hidden" name="category-icon" class="category-icon" value="{$category_info['category_icon']}">
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">首页显示</label>
                            <div class="layui-input-block">
                                <input type="checkbox" name="index_show" lay-skin="switch" lay-filter="index_show" value="{$category_info['index_show']}" {if $category_info['index_show'] eq 1}checked{/if}>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">排序</label>
                            <div class="layui-input-block">
                                <input type="text" name="f_order" placeholder="越大越靠前" class="layui-input" value="{$category_info['f_order']}">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">标题</label>
                            <div class="layui-input-block">
                                <input type="text" name="title" placeholder="非必填" class="layui-input" value="{$category_info['title']}">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">关键字</label>
                            <div class="layui-input-block">
                                <input type="text" name="keywords" placeholder="非必填" class="layui-input" value="{$category_info['keywords']}">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">描述</label>
                            <div class="layui-input-block">
                                <textarea name="description" placeholder="非必填" class="layui-textarea">{$category_info['description']}</textarea>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">&nbsp;</label>
                            <div class="layui-input-inline">
                                <input type="hidden" name="id" value="{$category_id}">
                                <button type="button" class="layui-btn" id="save">保　　存</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <!-- main end -->

    </div>


    {include file="layout/footerJs.html"}
    <script src="/assets/layui/js/category/category_select.js"></script>
    <script src="/assets/layui/js/category/category_add_update.js"></script>
</body>
</html>